-
Notifications
You must be signed in to change notification settings - Fork 124
Pqueue priorities #4273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Pqueue priorities #4273
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the elegance of this approach, allowing for priority vectors of arbitrary size. But I do wonder if the flexibility is worth the cost at the heart of the scheduler. Does this materially change the performance of the data structure? (due to extra mallocs). Would we be satisfied with simply having two values: a priority and a sub-priority?
|
One concern I'm having is that the priority data structure is widely used in other scenarios, to which only one priority value would make sense. As multiple priority values only apply to task scheduling, would it be easier to store the two priority values in |
|
With only one priority, the only thing that changes is the call to priority_queue_create. I think we still want the option for more than two, and it is likely that we will find situations where we want to have more control in the way tasks are ordered. I'm going to change it so that the two (or maybe three) priority values are stored in the struct element, so that only one malloc per push is needed. |
|
Further, note that with this change, the need for other functions is reduced, such as the functions that modify the priority of an element, or the function that looks for the largest priority, etc. |
|
That sounds good to me. |
|
@JinZhou5042 For example see the small change in vine_schedule.c |
Use an array of priorities instead of a single priority per element. Priorities are compared in lexicographical order.
The idea is to be able to do:
where all
RECOVERYcome before allEXHAUSTION, etc.Merge Checklist
The following items must be completed before PRs can be merged.
Check these off to verify you have completed all steps.
make testRun local tests prior to pushing.make formatFormat source code to comply with lint policies. Note that some lint errors can only be resolved manually (e.g., Python)make lintRun lint on source code prior to pushing.